{% extends 'base.html' %}
{% block title %} - Project {{project.name}} edit mode{% endblock %}
{% block js %}
<script type="text/javascript" src="/site_media/js/jquery.wysiwyg.js"></script>
<script type="text/javascript" src="/site_media/js/flowplayer-3.0.3.min.js"></script>
<link rel="stylesheet" href="/site_media/css/jquery.wysiwyg.css" type="text/css" />
<script type="text/javascript" src="/site_media/js/project.js"></script>
<script type="text/javascript">
	$(function(){
		$('#wysiwyg').wysiwyg();
	});
</script>
<script type="text/javascript" src="/site_media/js/flowplayer-3.0.3.min.js"></script>
{% endblock %}
{% block content %}
<div id="content" style="position:absolute; top:20px; left:0px; width:1000px; height:relative; background-color: #1A1A1A; layer-background-color: #1A1A1A; border: 1px none #000000; z-index:1">
<table>
	<tr>
		<td colspan="2">
			<table width="100%" border="0" cellspacing="10">
				<tr>
					<td class="Headline_player">
						Thanks for letting us pitch on this great Job. 
						<button onclick="window.location.href ='/project/{{project.id}}/'" >View</button>
						<input type="button" value="Import Assets" onclick="upload_basket({{project.id}});" />
					</td>
				</tr>
			</table>
			<table width="980" height="8" cellpadding="0" cellspacing="0">
				<tr class="text">
					<td width="76" bgcolor="#b3995d"></td>
					<td width="922" bgcolor="#323232"></td>
				</tr>
			</table>
		</td>
	</tr> 
	<tr>
		<td>
			<form action="/project/{{project.id}}/change_name/" method="post">
				<table border="0" align="left" cellpadding="0" cellspacing="10">
					<tr>
						<th class="Headline_white">Project:</th>
						<td>
							<span class="Title_Proj_name"><input name="project_name" type="text" value="{{project.name}}"/></span>
						</td>
					</tr>
					<tr>
						<th class="Headline_white">Brand:</th>
						<td class="Title_Proj_info2" colspan="3"><input name="project_brand" type="text" value="{{project.brand}}"/></td>
					</tr>
					<tr>
						<th class="Headline_white">For You:</th>
						<td class="Title_Proj_info2" colspan="3"><input name="project_city" type="text" value="{{project.city}}"/></td>
					</tr>
					<tr>
						<td class="Headline_white_small">Producer:</td>
						<td class="Title_project_info_small" colspan="3">
						<span class="text">
							{{project.creator.first_name}}, {{project.creator.last_name}}
							<a href="mailto:{{project.creator.email}}">{{project.creator.email}}</a>
						</span></td>
					</tr>
					<tr>
						<td class="Headline_white_small">Supervision:</td>
						<td class="Title_project_info_small" colspan="3"><span class="text">{{project.creator.first_name}}, {{project.creator.last_name}} ({{project.creator.username}})</span><br/></td>
						<td align="right" valign="bottom"><br/><input type="submit" value="Change"/></td>
					</tr>
				</table>
			</form>
		</td>
		<td>
			<table>
				<tr><td colspan="4">E-mail clients: <input type="button" onclick="add_project_client({{project.id}});" value="Add Email Client"/></td></tr>
				<tr>
					<td colspan="4">                        
					{% for pce in pces %}
						{{pce.title}} {{pce.name}} (<a href="mailto:{{pce.email}}">{{pce.email}}</a>) 
						<a href="/project/{{project.id}}/client_email/{{pce.id}}/" onclick="return confirm('Delete this client email?');">
						<img src="/site_media/img/trash.gif">
						</a>
						<br>
					{% endfor %}
					</td>
				</tr>	    
			</table>
		</td>
	</tr>
	<tr>
		<td>
			<form method="post" action="/project/{{project.id}}/save/">
				<table width="562" border="0" cellspacing="10">		
					<tr>
						<td class="text"><p>Description:</p>
							<textarea name="description" {% if user.is_authenticated %}id="wysiwyg"{% endif %} rows="10" cols="82">{{project.description}}</textarea>
							<input type="submit" value="Change">
						</td>
					</tr>    
				</table>
			</form>
		</td>
		<td>
			<table width="100%" border="0" align="center" cellspacing="10" class="text">    
				<tr>
					<td colspan="2">Attachments:</td>
				</tr>
			    {% for pf in attachs %}
				<tr>
					<td class="Headline_white_small">
						{{pf.title}}
					</td>
					<td>&gt;
						<a href="/{{pf.url}}">
						download</a><br/>
					</td>
					<td>
						<input type="checkbox" onclick="show_basket(this, {{pf.id}});" {% if not pf.hide %}checked="checked"{% endif %}/> visible
					</td>
					<td>
						<a href="javascript:;delete_basket({{pf.id}});">
							<img src="/site_media/img/trash.gif"> 
						</a>
					</td>
				</tr>
			    {% endfor %}
			</table>
		</td>
	</tr>	
	<tr>
		<td colspan="2">
			<div>
			<p>Videos: <hr></p>
				{% for v in videos %}
					<span class="box">
						<a href="javascript:;delete_basket({{v.id}});">
							<img src="/site_media/img/trash.gif"> 
						</a>
						<input type="checkbox" onclick="show_basket(this, {{v.id}});" {% if not v.hide %}checked="checked"{% endif %}/> visible
						<a href="javascript:;play_video({{v.id}}, '{{v.url}}', true);">
						{% load zdy_filter %}
							<img src="/{{v.url|get_project_file_img}}" width="100px" height="100px" />
						</a> <br/>	
						{{v.title}} 
					</span>
				{% endfor %}
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<div>
			<p>Images: <hr></p>
				{% for v in images %}
					<span class="box">
						<a href="javascript:;delete_basket({{v.id}});">
							<img src="/site_media/img/trash.gif"> 
						</a>
						<input type="checkbox" onclick="show_basket(this, {{v.id}});" {% if not v.hide %}checked="checked"{% endif %}/> visible
						<a href="javascript:;play_image({{v.id}}, '{{v.url}}', true);">
							<img src="/{{v.url}}" width="100px" height="100px" />
						</a> <br/>
						{{v.title}} 
					</span>
				{% endfor %}
			</div>
		</td>
	</tr>
	<tr>
		<td colspan="2">
			<div>
			<p>Youtubes: <hr></p>
				{% for v in youtubes %}
					<span class="box">
						<a href="javascript:;delete_basket({{v.id}});">
							<img src="/site_media/img/trash.gif"> 
						</a>
						<input type="checkbox" onclick="show_basket(this, {{v.id}});" {% if not v.hide %}checked="checked"{% endif %}/> visible
						<a href="javascript:;play_youtube({{v.id}}, '{{v.url}}', true);">
							<img src="http://img.youtube.com/vi/{{v.url}}/1.jpg" width="100px" height="100px" />
						</a> <br/>
						{{v.title}} 
					</span>
				{% endfor %}
			</div>
		</td>
	</tr>
	<tr><td align="left"><INPUT TYPE="button" VALUE="Back" onclick="window.location='/project/{{project.id}}/';"></td></tr>
</table>
</div>
<div id="dialog"></div>
{% endblock %}